<nav class="navbar">
    <button class="btn btn-default navbar-btn fa fa-bars"></button>
    <ul class="nav navbar-nav navbar-right">
      <li><a href="/admin/profile"><i class="fa fa-user"></i>个人中心</a></li>
      <li><a href="javascript:;" onclick="exit()"><i class="fa fa-sign-out"></i>退出</a></li>
    </ul>
  </nav>

<!-- //给退出按钮注册点击事件，点击退出的时候发送ajax请求，请求退出并删除cookie值 -->
<script>
  function exit(){
    $.ajax({
      url:'/loginOut',
      type:'get',
      dataType:'json',
      success:function(res){
        if(res.code==200){
          location.href = '/login'
        }
      }
    })
  }
</script>
